From 555cf2f748b88c47172e4292d438a91c01387f00 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Wed, 9 Mar 2022 23:33:16 +0100
Subject: fix: add a spinner if blog page is loading

---
 src/pages/blog/page/[id].tsx | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'src/pages/blog/page/[id].tsx')

diff --git a/src/pages/blog/page/[id].tsx b/src/pages/blog/page/[id].tsx
index 3be058b..2cbd486 100644
--- a/src/pages/blog/page/[id].tsx
+++ b/src/pages/blog/page/[id].tsx
@@ -24,6 +24,7 @@ import { Blog, Graph, WebPage } from 'schema-dts';
 import styles from '@styles/pages/Page.module.scss';
 import { getFormattedPageNumbers } from '@utils/helpers/format';
 import { useEffect } from 'react';
+import Spinner from '@components/Spinner/Spinner';
 
 const BlogPage: NextPageWithLayout<BlogPageProps> = ({
   allThematics,
@@ -39,6 +40,8 @@ const BlogPage: NextPageWithLayout<BlogPageProps> = ({
     if (router.query.id === '1') router.push('/blog');
   }, [router]);
 
+  if (router.isFallback) return <Spinner />;
+
   const pageTitle = intl.formatMessage(
     {
       defaultMessage: `Blog - Page {number} - {websiteName}`,
-- 
cgit v1.2.3

